﻿using Adp.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Nhd.Models
{
    public class NhdContext : DbContext
    {
        public NhdContext(DbContextOptions<NhdContext> options) : base(options)
        {
        }
        public NhdContext()
        {
        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(Adp.Env.DbContextSetting(optionsBuilder, "DefaultConnection"));
        }
        public DbSet<Nhd_Community> Nhd_Community { get; set; }
        public DbSet<Nhd_Grid> Nhd_Grid { get; set; }
        public DbSet<Nhd_People> Nhd_People { get; set; }
        public DbSet<Nhd_PeopleReg> Nhd_PeopleReg { get; set; }
        public DbSet<Nhd_Street> Nhd_Street { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Nhd_Community>().ToTable("Nhd_Community");
            modelBuilder.Entity<Nhd_Grid>().ToTable("Nhd_Grid");
            modelBuilder.Entity<Nhd_People>().ToTable("Nhd_People");
            modelBuilder.Entity<Nhd_PeopleReg>().ToTable("Nhd_PeopleReg");
            modelBuilder.Entity<Nhd_Street>().ToTable("Nhd_Street");
        }
    }
}
